import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'

export default defineConfig({
    plugins: [uni()],
    server: {
        host: "localhost",  //指定服务器应该监听哪个IP地址，默认：1ocalhost
        port: 6060,         //指定服务器端口，默认：5173
        proxy: {            //为开发服务器配置自定义代理规则
            // 带选项写法：http://localhost:8899/api/posts -> http://localhost:7070/posts
            "/scp": {
                target: "http://localhost:9090",
                changeOrigin: true,
                rewrite: (path) => path.replace(/^\/scp/, "")
            }
        }
    }
})